<?php

use Dcat\Admin\Admin;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

Admin::routes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    Route::get('/relations', function () {
        $userId = request()->get('userId', 0);
        return sprintf("<pre>%s</pre>", \App\Services\Relation\UserTreeService::make($userId));
    });

    $router->resource('users', 'UserController')->only(['index', 'show']);
    $router->resource('unusual-users', 'UnusualUserController')->only(['index', 'show']);
    $router->resource('blocked-users', 'BlockedUserController')->only(['index', 'show']);
    $router->resource('admodels', 'AdmodelController');
    $router->resource('adtypes', 'AdtypeController');
    $router->resource('task', 'TaskController');
    $router->resource('adplatform', 'AdplatformController');
    $router->resource('adrewards', 'AdrewardController')->only(['index']);
    $router->resource('adreward-details', 'AdrewardDetailController')->only(['index']);
    $router->resource('task-details', 'TaskDetailController')->only(['index']);
    $router->resource('user-withdraws', 'UserWithdrawController')->only(['index']);
    $router->resource('group-withdraws', 'GroupWithdrawController')->only(['index']);
    $router->resource('group-members', 'GroupMemberController')->only(['index']);
    $router->resource('group-applies', 'GroupApplyController')->only(['index']);
    $router->resource('user-wallet-actives', 'UserWalletActiveController')->only(['index']);
    $router->resource('commissions', 'CommissionController')->only(['index']);
    $router->resource('groupcash', 'GroupcashController')->only(['index']);
    $router->resource('directinvite', 'DirectinviteController')->only(['index']);
    $router->resource('groups', 'GroupController');
    $router->resource('orders', 'OrderController')->only(['index']);
    $router->resource('big-screen', 'BigScreenController')->only(['index']);
    $router->resource('withdraw-data','WithdrawController')->only(['index']);
    $router->resource('app-config','AppConfigController');
    $router->get('user-adreward-details','AdrewardDetailController@userAdrewardDetails');
    $router->get('configs', 'SettingController@index');
    $router->post('configs', 'SettingController@index');

    $router->resource('apps', 'AppController');
    $router->resource('notice', 'NoticeController');//公告
    $router->resource('goods', 'GoodsController');//商品
    $router->resource('goodsorder', 'GoodsorderController');//商品
});
